package com.whfc.fse.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.whfc.fse.constant.CrawlerMeasurement;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;

import java.io.Serializable;
import java.time.Instant;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * 履带吊硬件数据
 *
 * @author qzexing
 * @version 1.0
 * @date 2021/10/30 16:24
 */
@Data
@Measurement(name = CrawlerMeasurement.MEASUREMENT, database = CrawlerMeasurement.DATABASE, retentionPolicy = CrawlerMeasurement.RETENTION_POLICY, timeUnit = TimeUnit.SECONDS)
public class FseCrawlerDataLogDTO implements Serializable {

    /**
     * 服务器时间
     */
    private Date createTime;

    /**
     * 时间
     */
    @JsonFormat(pattern = "HH:mm")
    private Date time;

    /**
     * 硬件时间
     */
    @JsonIgnore
    @Column(name = "time")
    private Instant deviceTime;

    /**
     * 服务器时间
     */
    @JsonIgnore
    @Column(name = "serverTime")
    private Long serverTime;

    /**
     * 主钩吊重
     */
    @Column(name = "mainHookWeight")
    private Double mainHookWeight;

    /**
     * 主钩高度
     */
    @Column(name = "mainHookHeight")
    private Double mainHookHeight;

    /**
     * 主钩力矩
     */
    @Column(name = "mainHookMoment")
    private Double mainHookMoment;

    /**
     * 副钩吊重
     */
    @Column(name = "viceHookWeight")
    private Double viceHookWeight;

    /**
     * 副钩高度
     */
    @Column(name = "viceHookHeight")
    private Double viceHookHeight;

    /**
     * 副钩力矩
     */
    @Column(name = "viceHookMoment")
    private Double viceHookMoment;

    /**
     * 幅度
     */
    @Column(name = "range")
    private Double range;

    /**
     * 风速
     */
    @Column(name = "windSpeed")
    private Double windSpeed;

    /**
     * 回转速度
     */
    @Column(name = "turnSpeed")
    private Double turnSpeed;

    /**
     * 回转角度
     */
    @Column(name = "turnAngle")
    private Double turnAngle;

    /**
     * 俯仰角
     */
    @Column(name = "dipAngle")
    private Double dipAngle;

    /**
     * 水平度
     */
    @Column(name = "levelness")
    private Double levelness;

    /**
     * 工况设置
     */
    @Column(name = "conditions")
    private Integer conditions;

    /**
     * 累计超载次数
     */
    @Column(name = "totalOverloadCnt")
    private Integer totalOverloadCnt;

    /**
     * 累计抗风作业次数
     */
    @Column(name = "totalWindWorkCnt")
    private Integer totalWindWorkCnt;

    /**
     * 累计工作时长
     */
    @Column(name = "totalWorkTimes")
    private Integer totalWorkTimes;

    /**
     * 累计吊装次数
     */
    @Column(name = "totalWorkCnt")
    private Integer totalWorkCnt;

    /**
     * 工作循环开始
     */
    @Column(name = "workStartTime")
    private Long workStartTime;

    /**
     * 工作循环结束
     */
    @Column(name = "workEndTime")
    private Long workEndTime;

    /**
     * 主升动作累计次数
     */
    @Column(name = "totalMainCnt")
    private Integer totalMainCnt;

    /**
     * 副升动作累计次数
     */
    @Column(name = "totalViceCnt")
    private Integer totalViceCnt;

    /**
     * 累计回转次数
     */
    @Column(name = "totalTurnCnt")
    private Integer totalTurnCnt;

    /**
     * 状态
     */
    @Column(name = "state")
    private Integer state;

    /**
     * 动作
     */
    @Column(name = "action")
    private Integer action;

    /**
     * 行程
     */
    @Column(name = "trip")
    private Integer trip;

    /**
     * 回转报警
     */
    @Column(name = "turnWarn")
    private Integer turnWarn;

    /**
     * 主钩高度报警
     */
    @Column(name = "mainHookHeightWarn")
    private Integer mainHookHeightWarn;

    /**
     * 主钩重量报警
     */
    @Column(name = "mainHookWeightWarn")
    private Integer mainHookWeightWarn;

    /**
     * 副钩高度报警
     */
    @Column(name = "viceHookHeightWarn")
    private Integer viceHookHeightWarn;

    /**
     * 副钩重量报警
     */
    @Column(name = "viceHookWeightWarn")
    private Integer viceHookWeightWarn;

    /**
     * 防后倾报警
     */
    @Column(name = "dipAngleWarn")
    private Integer dipAngleWarn;

    /**
     * 风速报警
     */
    @Column(name = "windSpeedWarn")
    private Integer windSpeedWarn;

    /**
     * 不正常操作报警
     */
    @Column(name = "abnormalOpWarn")
    private Integer abnormalOpWarn;

    /**
     * 回转左转
     */
    @Column(name = "turnLeft")
    private Integer turnLeft;

    /**
     * 回转左转
     */
    @Column(name = "turnRight")
    private Integer turnRight;

    /**
     * 主钩上升
     */
    @Column(name = "mainHookUp")
    private Integer mainHookUp;

    /**
     * 主钩下降
     */
    @Column(name = "mainHookDown")
    private Integer mainHookDown;

    /**
     * 副钩上升
     */
    @Column(name = "viceHookUp")
    private Integer viceHookUp;

    /**
     * 副钩下降
     */
    @Column(name = "viceHookDown")
    private Integer viceHookDown;

    /**
     * 主钩抱闸状态
     */
    @Column(name = "mainHookBrake")
    private Integer mainHookBrake;

    /**
     * 副钩抱闸状态
     */
    @Column(name = "viceHookBrake")
    private Integer viceHookBrake;

    /**
     * 防后倾限位
     */
    @Column(name = "dipAngleLimit")
    private Integer dipAngleLimit;

    /**
     * 门限位
     */
    @Column(name = "doorLimit")
    private Integer doorLimit;

    /**
     * 主钩高度上限位
     */
    @Column(name = "mainHookHeightUpperLimit")
    private Integer mainHookHeightUpperLimit;

    /**
     * 主钩高度下限位
     */
    @Column(name = "mainHookHeightLowerLimit")
    private Integer mainHookHeightLowerLimit;

    /**
     * 副钩高度上限位
     */
    @Column(name = "viceHookHeightUpperLimit")
    private Integer viceHookHeightUpperLimit;

    /**
     * 副钩高度下限位
     */
    @Column(name = "viceHookHeightLowerLimit")
    private Integer viceHookHeightLowerLimit;

    /**
     * 高度下限
     */
    @Column(name = "minHeight")
    private Double minHeight;

    /**
     * 高度上限
     */
    @Column(name = "maxHeight")
    private Double maxHeight;

    /**
     * 防碰撞探测距离集合 json
     */
    @Column(name = "probeDistances")
    private String probeDistances;

    /**
     * 防碰撞探测距离集合
     */
    private List<Double> probeDistanceList;

    /**
     * 防碰撞报警集合 json
     */
    @Column(name = "probeDistanceWarns")
    private String probeDistanceWarns;

    /**
     * 防碰撞报警
     */
    private Integer probeDistanceWarn;


}